package com.lzc.springboot_jsp_shiro.utils;

import java.util.Random;

/**
 * 生成盐工具类
 */
public class SaltUtils {

    public static String getSalt(int n) {
        char[] chars = "qwertyuioplkjhgfdsazxcvbnm!@#$%%^&*()0987654321`".toCharArray();
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < n; i++) {
            char aChar = chars[new Random().nextInt(chars.length)];
            stringBuilder.append(aChar);
        }
        return stringBuilder.toString();
    }
}
